<?php
namespace Member\Model;
use Think\Model;

class WechatAppModel extends Model {
	
	protected $_validate = array(
			array('title', 'require', '公众号名称不能为空！', self::MUST_VALIDATE),
			array('wxid', 'require', '账号原始ID不能为空！', self::MUST_VALIDATE),
			/* 验证邮箱 */
			array('email', 'email', '邮箱格式不正确', self::MUST_VALIDATE),
			array('email', '1,32', '邮箱长度不合法', self::MUST_VALIDATE, 'length'),
			//array('email', '', '邮箱被占用', self::MUST_VALIDATE, 'unique'),
	);
	
	protected $_auto = array(
			array('uid', 'is_login', self::MODEL_INSERT, 'function'),
			array('create_time', NOW_TIME, self::MODEL_INSERT, 'string'),
			array('update_time', NOW_TIME, self::MODEL_UPDATE, 'string'),
			array('verified', '0', self::MODEL_INSERT, 'string'),
			array('verify_time', '0',self::MODEL_INSERT, 'string'),
			array('token', 'md5', self::MODEL_INSERT, 'function', NOW_TIME)
	);
}